package com.apes.scm.masterdata.product.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.jpa.generator.Implementation;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 功能：服务类型
 *
 * @author HuJianlin
 * @create 2018-03-15 16:00
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = "mas_serve_type")
public class ServeType extends Model {

    @Id
    @Column(name = "id", length = 8)
    @Comment("服务类型编码")
    @ApesGenerator(code = "mas_serve_type", name = "服务类型",padding = 4,implementation = Implementation.NO_GAP)
    private String id;  //服务类型编码

    @Column(name = "name", nullable = false, length = 120)
    @Comment("服务类型名称")
    private String name; //服务类型名称


    @Column(name = "is_vehicle_File_Upload", nullable = false, columnDefinition = "number(1,0) default 0")
    @Comment("是否上传汽车健康档案")
    private boolean vehicleFileUpload ;

    @Column(name = "valid", nullable = false, columnDefinition = "number(1,0) default 1")
    @Comment("有效")
    private boolean valid ; //有效

    @Column(name = "superior_id",  length = 8)
    @Comment("上级编码")
    private String superiorId;

}
